<template>
	<view>
		<view class="help">
			<view class="list-cell b-b" hover-class="cell-hover" v-for="(h,index) in list" :hover-stay-time="50" @click="navTo(h)">
				<text class="cell-tit">{{index+1}}.{{h.title}}</text>
				<text class="cell-more iconfont icon-you"></text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[]
			};
		},
		onLoad(options) {
			this.loadData();
		},
		methods:{
			navTo(target){
				uni.setStorageSync('helps', JSON.stringify(target));
				uni.navigateTo({  
					url:"/pages/helps/detail"
				})  
			},
			loadData(){
				this.$request.post("/helps/getHelps", {
					dataType: 'json',
					responseType: 'text'
				})
				.then(res => {
					this.list = res.data.json;
				})
				.catch(error => {
				});
			}
		}
	}
</script>

<style lang="scss">
	.bg-img image{
		width: 100%;
	}
	.help{
		position: relative;
		top: -30rpx;
		border-radius: 30rpx 30rpx 0 0;
		background-color: #FFFFFF;
		padding-top: 30rpx;
	}
	.list-cell{
		display:flex;
		align-items:baseline;
		padding: 20upx $page-row-spacing;
		line-height:60upx;
		position:relative;
		background: #fff;
		justify-content: center;
		&.log-out-btn{
			margin-top: 40upx;
			.cell-tit{
				color: $uni-color-primary;
				text-align: center;
				margin-right: 0;
			}
		}
		&.cell-hover{
			background:#fafafa;
		}
		&.b-b:after{
			left: 30rpx;
			right: 30rpx;
		}
		&.m-t{
			margin-top: 16rpx;
		}
		.cell-more{
			align-self: baseline;
			font-size:$font-lg;
			color:$font-color-light;
			margin-left:10upx;
		}
		.cell-tit{
			flex: 1;
			font-size: 32rpx;
			color: $font-color-dark;
			margin-right:10rpx;
		}
		.cell-tip{
			font-size: $font-base;
			color: $font-color-light;
		}
		switch{
			transform: translateX(16upx) scale(.84);
		}
	}
</style>
